\subsection{{\tt{mandel}}: Mandelbrot Set Generation\label{s:toys-mandel}}

This module generates the Mandelbrot Set for a specified region of the complex plane.

{\inputspec}

\begin{description}
\item[{\tt{nrows, ncols}}:]
	the number of rows and columns in the output matrix.
\item[{\tt{x0, y0}}:]
	the real coordinates of the lower-left corner of the region to be generated.
\item[{\tt{dx, dy}}:]
	the extent of the region to be generated.
\end{description}

{\outputspec}

\begin{description}
\item[{\tt{matrix}}:]
	an integer matrix containing the iteration count at each point in the region.
\end{description}

Given initial coordinates $(x_0, y_0)$,
the Mandelbrot Set is generated by iterating the equation
\begin{eqnarray*}
x^{\prime}	& =	& x^2 - y^2 + y_0	\\
y^{\prime}	& =	& 2{x}{y} + x_0
\end{eqnarray*}
until either an iteration limit is reached,
or the values diverge.
The iteration limit used in this module is 150 steps;
divergence occurs when $x^2 + y^2$ becomes 2.0 or greater.
The integer value of each element of the matrix is
the number of iterations done.

If possible,
the values produced should depend only on the size of the matrix and the seed,
\emph{not} on the number of processors or threads used.
